package 算术基本定理.丑数;

/**
 * TODO
 *
 * @className: pdcs
 * @description: TODO
 * @author: 等什么柠檬君
 * @date: 2022-05-06 21:37
 **/
public class pdcs {
    public static void main(String[] args) {
        System.out.println(isUgly(0));
    }
    public static boolean isUgly(int n) {
        if (n == 0){
            return false;
        }
        while (n % 2 == 0){
            n /= 2;
        }
        while (n % 3 == 0){
            n /= 3;
        }
        while (n % 5 == 0){
            n /= 5;
        }
        return n == 1;
    }
}
